home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
Graphics
/
ContourPlot
/
Source
/
contour.h
< prev
next >
Wrap
Text File
|
1993-01-13
|
2KB
|
52 lines
/* contour.h */
#import <appkit/color.h>
#define epsilon .0002
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y)) /* min and max value macros */
#endif
#ifndef MAX
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
/* Each contour path found is stored in this structure */
typedef struct contour_path {
struct contour_path *next; /* pointer to next contour path */
float *x; /* X coordinate array */
float *y; /* Y coordinate array */
float level; /* contour's level */
int num_pts; /* # of points in this path */
int closed; /* non-zero if contour is closed */
int levelindex; /* levelindex-th contour level */
int hi_inside; /* non-zero if inside contour is going up */
} ContourPath;
/* User specified attribute for each contour level */
typedef struct contour_attribute {
float level; /* value of contour level */
float linewidth; /* line width */
int dash; /* dash type */
int anotate; /* non-zero if this contour should be annotated */
NXColor linecolor; /* color of contour line */
NXColor fillcolor_hi; /* color of fill when inside is higher */
NXColor fillcolor_lo; /* color of fill when inside is lower */
} CntrAttribute;
int computeContour(id vObj, int nx, int ny, float *x, float *y, float *f,
int ncont, CntrAttribute *cAttr);
void sort_contourList(ContourPath *cntrList, float xxmin, float xxmax, float yymin, float yymax,
int nContours, ContourPath **SCntrPtr);
int non_zero_winding(float xp, float yp, float *x, float *y, int n_path);